#include "bullet.h"

bullet::bullet()
{
    m_bullet.load(BULLET_PATH);

    m_X=GAME_WIDTH*0.5-m_bullet.width()*0.5;
    m_Y=GAME_HEIGHT;

    m_Free=true;

    m_Speed=BULLET_SPEED;
    m_Rect.setWidth(m_bullet.width());
    m_Rect.setHeight(m_bullet.height());
    m_Rect.moveTo(m_X,m_Y);


}
void bullet::updatePosition(){
    if(m_Free)
    {
        return;
    }
    m_Y-=m_Speed;
    m_Rect.moveTo(m_X,m_Y);
    if(m_Y<=-m_Rect.height())
    {
        m_Free=true;
    }





}
